#include <iostream>

// 左移运算符重载
class Person
{
public:
    int m_A;
    int m_B;
};

// 只能用全局函数方式实现左移运算符重载
std::ostream& operator<<(std::ostream &cout, Person &p)
{
    cout << "m_A = " << p.m_A << std::endl;
    cout << "m_B = " << p.m_B << std::endl;
    return cout;
}

void test01()
{
    Person p;
    p.m_A = 10;
    p.m_B = 10;
    std::cout << p << std::endl;
}

int main()
{
    test01();
    return 0;
}